/*
 * @Description: 悟空软件
 * @Author: 悟空
 * @Date: 2020-06-04 10:40:32
 * @LastEditTime: 2020-07-01 10:02:16
 * @LastEditors: yang
 */
import request from '@/utils/request'

/**
 * 招聘计划详情
 * @param {*} id
 */
export function hrmRecruitPlanQueryByIdAPI(id) {
  return request({
    url: `hrmRecruitPlan/queryById/${id}`,
    method: 'post'
  })
}

/**
 * 列表
 * @param {*} data
 */
export function hrmRecruitPlanQueryListAPI(data) {
  return request({
    url: 'hrmRecruitPlan/queryRecruitPlanPageList',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 添加招聘计划
 * @param {*} data
 */
export function hrmRecruitPlanAddAPI(data) {
  return request({
    url: 'hrmRecruitPlan/addRecruitPlan',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 修改招聘计划
 * @param {*} data
 */
export function hrmRecruitPlanSetAPI(data) {
  return request({
    url: 'hrmRecruitPlan/setRecruitPlan',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 删除招聘计划
 * @param {*} id
 */
export function hrmRecruitPlanDeleteAPI(id) {
  return request({
    url: `hrmRecruitPlan/deleteRecruitPlan/${id}`,
    method: 'post'
  })
}

/**
 * 上报招聘计划
 * @param {*} id
 */
export function hrmRecruitPlanReportAPI(id) {
  return request({
    url: `hrmRecruitPlan/syncPlan/${id}`,
    method: 'post'
  })
}


/**
 * 导出
 * @param {*} data
 */
export function hrmRecruitPlanExportAPI(data) {
  return request({
    url: 'hrmRecruitPlan/exportRecruitPlan',
    method: 'post',
    data: data,
    responseType: 'blob',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 获取导入模板
 * @param {*} data
 */
export function planImportTemplateAPI() {
  return request({
    url: 'hrmRecruitPlan/downloadExcel',
    method: 'post',
    responseType: 'blob',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 导入
 * @param {*} data
 */
export function planExcelImportAPI(data) {
  return request({
    url: 'hrmRecruitPlan/excelImport',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

/**
 * 查询招聘计划日志
 * @param {*} id
 */
export function hrmRecruitPlanQueryLogAPI(id) {
  return request({
    url: `hrmRecruitReportLog/queryByPlanId/${id}`,
    method: 'post'
  })
}

